package biz.common.mgbean;

import biz.common.service.ProdLocationSvr;
import biz.master.dto.Area;
import biz.master.dto.Branch;
import biz.master.dto.Location;
import biz.master.dto.Warehouse;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import java.util.List;

/**
 * Created by Test on 3/6/14.
 */
@ManagedBean(name = "prodLocationMgb")
@ViewScoped
public class ProdLocationMgb {
    private int areaId;
    private String areaCode;
    private String areaName;
    private int branchId;
    private String branchCode;
    private String branchName;
    private int warehouseId;
    private String warehouseCode;
    private String warehouseName;
    private int locationId;
    private String locationCode;
    private String locationName;

    private ProdLocationSvr svr = new ProdLocationSvr();

    public int getAreaId() {
        return areaId;
    }

    public void setAreaId(int areaId) {
        this.areaId = areaId;
    }

    public String getAreaCode() {
        return areaCode;
    }

    public void setAreaCode(String areaCode) {
        this.areaCode = areaCode;
    }

    public String getAreaName() {
        return areaName;
    }

    public void setAreaName(String areaName) {
        this.areaName = areaName;
    }

    public int getBranchId() {
        return branchId;
    }

    public void setBranchId(int branchId) {
        this.branchId = branchId;
    }

    public String getBranchCode() {
        return branchCode;
    }

    public void setBranchCode(String branchCode) {
        this.branchCode = branchCode;
    }

    public String getBranchName() {
        return branchName;
    }

    public void setBranchName(String branchName) {
        this.branchName = branchName;
    }

    public int getWarehouseId() {
        return warehouseId;
    }

    public void setWarehouseId(int warehouseId) {
        this.warehouseId = warehouseId;
    }

    public String getWarehouseCode() {
        return warehouseCode;
    }

    public void setWarehouseCode(String warehouseCode) {
        this.warehouseCode = warehouseCode;
    }

    public String getWarehouseName() {
        return warehouseName;
    }

    public void setWarehouseName(String warehouseName) {
        this.warehouseName = warehouseName;
    }

    public int getLocationId() {
        return locationId;
    }

    public void setLocationId(int locationId) {
        this.locationId = locationId;
    }

    public String getLocationCode() {
        return locationCode;
    }

    public void setLocationCode(String locationCode) {
        this.locationCode = locationCode;
    }

    public String getLocationName() {
        return locationName;
    }

    public void setLocationName(String locationName) {
        this.locationName = locationName;
    }

    public List<Area> getAreaList() {

        return svr.searchArea(null);
    }

    public void changeProdLocation() {

    }

    public List<Branch> getBranchList() {
        return svr.searchBranchByArea(areaId);
    }

    public List<Warehouse> getWarehouseList() {
        return svr.searchWarehouseByBranch(branchId);
    }

    public List<Location> getLocationList() {
        return svr.searchLocationByWarehouse(warehouseId);
    }
}
